﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using Org.Eurekaa.DNJ.Settings;

namespace Org.Eurekaa.DNJ.UI.DNJSettings
{
    [Serializable()]
    public class DNJDatePickerSettings : GenericSettingsObject
    {
        #region [ DNJ Settings ]

        [Description("The text to display after each date field, e.g. to show the required format.")]
        [DefaultValue(""), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public string AppendText
        {
            get { return Get<String>("appendText"); }
            set { this["appendText"] = value; }
        }


        [Description("The URL for the popup button image. If set, button text becomes the alt value and is not directly displayed.")]
        [Editor(typeof(System.Web.UI.Design.UrlEditor), typeof(System.Drawing.Design.UITypeEditor))]
        [DefaultValue(""),NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public string ButtonImage
        {
            get { return Get<string>("buttonImage"); }
            set { this["buttonImage"] = value; }
        }
        
        [Description("Set to true to place an image after the field to use as the trigger without it appearing on a button.")]
        [DefaultValue(false),NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool ButtonImageOnly
        {
            get { return Get<bool>("buttonImageOnly"); }
            set { this["buttonImageOnly"] = value; }
        }



        [Description("Allows you to change the month by selecting from a drop-down list. You can enable this feature by setting the attribute to true.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool ChangeMonth
        {
            get { return Get<bool>("changeMonth"); }
            set { this["changeMonth"] = value; }
        }

        [Description("Allows you to change the year by selecting from a drop-down list. You can enable this feature by setting the attribute to true.")]
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool ChangeYear
        {
            get { return Get<bool>("changeYear"); }
            set { this["changeYear"] = value; }
        }


        [Description("The format for parsed and displayed dates. This attribute is one of the regionalisation attributes. (see http://docs.jquery.com/UI/Datepicker/formatDate for possible date formats)")]
        [DefaultValue("mm/dd/yy"), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public string DateFormat
        {
            get { return Get<String>("dateFormat"); }
            set { this["dateFormat"] = value; }
        }
        [Description("Set the date to highlight on first opening if the field is blank. Specify either an actual date via a Date object, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +7d'), or null for today.")]
        [NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public string DefaultDate
        {
            get { return Get<String>("defaultDate"); }
            set { this["defaultDate"] = value; }
        }
        // Non jQuery settings
        private bool inlineMode = false;
        [DefaultValue(false), NotifyParentProperty(true), RefreshProperties(RefreshProperties.Repaint)]
        public bool InlineMode
        {
            get { return inlineMode; }
            set { inlineMode = value; }
        }
        #endregion

        public DNJDatePickerSettings() : base()
        {
            DateFormat = "mm/dd/yy";
        }
    }
}
